package com.kch.system.service.impl;

import com.kch.system.domain.OtherConfig;
import com.kch.system.mapper.OtherConfigMapper;
import com.kch.system.service.IOtherConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class OtherConfigServiceImpl implements IOtherConfigService {

    @Autowired
    private OtherConfigMapper otherConfigMapper;


    @Override
    public int insertOtherConfig(OtherConfig otherConfig) {
        otherConfig.setCreateTime(new Date());
        return otherConfigMapper.insert(otherConfig);
    }

    @Override
    public OtherConfig selectByCloCode(String code, Integer id) {
        return otherConfigMapper.selectByCloCode(code, id);
    }

    @Override
    public int updateById(OtherConfig config) {
        return otherConfigMapper.updateByPrimaryKey(config);
    }

    @Override
    public List<OtherConfig> selectByCloCodeList(List<String> codes, OtherConfig config) {
        return otherConfigMapper.selectByCloCodeList(codes, config);
    }

    @Override
    public int deleteConfig(String ids) {
        return otherConfigMapper.deleteByPrimaryKey(Integer.valueOf(ids));
    }

    @Override
    public OtherConfig selectById(Integer id) {
        return otherConfigMapper.selectByPrimaryKey(id);
    }
}
